﻿using System.Runtime.Serialization;
using System;

namespace Kaesoft.Hospedaje.Entities
{
    public partial class Operacion
    {
        private bool _enabled;
        public event EventHandler onSelectedChanged;

        [DataMember]
        public bool Enabled
        {
            get
            {
                return _enabled;
            }
            set
            {
                if (_enabled != value)
                {
                    _enabled = value;
                    OnPropertyChanged("Enabled");
                }
            }
        }

        private bool _visible;

        [DataMember]
        public bool Visible
        {
            get
            {
                return _visible;
            }
            set
            {
                if (_visible != value)
                {
                    _visible = value;
                    OnPropertyChanged("Visible");
                }
            }
        }

        private bool _esSeleccionado;

        [DataMember]
        public bool EsSeleccionado
        {
           get { return _esSeleccionado; }
           set
           {
              if (value != _esSeleccionado)
              {
                 _esSeleccionado = value;
                 OnPropertyChanged("EsSeleccionado");
                 if (Bandera)
                    OnSelectedChanged();
              }
           }
        }

        private bool _bandera;

        [DataMember]
        public bool Bandera
        {
           get { return _bandera; }
           set
           {
              if (value != _bandera)
              {
                 _bandera = value;
                 OnPropertyChanged("Bandera");
              }
           }
        }

        public void OnSelectedChanged()
        {
           if (onSelectedChanged != null)
           {
              onSelectedChanged(this, new EventArgs());
           }
        }
    }
}